package com.ycz.cglib.load;

import lombok.Data;
import org.springframework.cglib.proxy.Enhancer;

/**
 * @author ycz
 * @date 2021/7/3
 * @description TODO
 * @Company © 版权所有 深圳市天行云供应链有限公司
 */
@Data
public class LoaderBean {

    private String loaderName;

    private int loaderValue;

    private PropertyBean propertyBean;

    public LoaderBean(){
        this.loaderName="loaderNameA";
        this.loaderValue=123;
        this.propertyBean=createPropertyBean();
    }
    protected PropertyBean createPropertyBean(){
        Enhancer enhancer=new Enhancer();
        enhancer.setSuperclass(PropertyBean.class);
        return (PropertyBean)enhancer.create(PropertyBean.class,new ConcreteClassLazyLoader());
    }

}
